package com.web.hr.service.impl;

import com.web.hr.cymapper.UserTableMapper;
import com.web.hr.cymodel.UserTable;
import com.web.hr.mapper.AuthorizationTableMapper;
import com.web.hr.model.AuthorizationTable;
import com.web.hr.service.MainService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@SuppressWarnings({"SpringJavaAutowiringInspection", "SpringAutowiredFieldsWarningInspection"})
@Service
@Transactional
public class MainServiceImpl implements MainService {

    @Autowired
    private AuthorizationTableMapper authorizationTableMapper;

    @Autowired
    private UserTableMapper userTableMapper;

    public AuthorizationTable selectDBAccessToken(String id) {
        return authorizationTableMapper.selectByPrimaryKey(id);
    }

    public Integer addUserRecord(UserTable record) {
        return userTableMapper.insert(record);
    }

    public UserTable getUserRecord(Integer i) {
        return userTableMapper.selectByID(i);
    }

}
